﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace SimplexEngine
{
    public class Core : Game
    {

        public Core()
        {
            Content.RootDirectory = "Content";

            // set static game to this
            game = this;
            root = Root.Instance;
            IsFixedTimeStep = false;         
        }

        protected override void Initialize()
        {
            Root.Instance.Init(this);
            base.Initialize();            
        }

        protected override void Update(GameTime game_time)
        {
            base.Update(game_time);

            root.Update(game_time);
        }

        protected override void Draw(GameTime game_time)
        {
            root.Draw(game_time);
            base.Draw(game_time);
        }

        Root root = null;

        protected static Game game = null;
        public static Game Game { get { return game; } }
    }
}
